#ifndef __COUMO_H__
#define __COUMO_H__

#include "coumo_types.h"
#include "coumo_sys.h"
#include "coumo_errorcode.h"

typedef unsigned LN_INT64 LN_OID;

#define LN_OID_OBJECT    0          /* Object */
#define LN_OID_RAW       1          /* Raw Pointer */
#define LN_OID_EXT       2          /* External Object */
#define LN_OID_MEM       3          /* Pointer to memory of this session */

#define LN_OID_TYPE(v)   (((unsigned)(v)) & 0x0000000F)
#define LN_OID_ADDR(v)   ((v) & ~0xF)

extern void ln_init  (void);
extern void ln_final (void);
extern int  ln_get_version (int *major, int *minor, int *patch);

extern int  ln_connect (char *ip, int port, char *user, char *passwd);
extern int  ln_disconnect (int con_handle);
extern int  ln_get_error (int error_code, char* err,int err_size);

extern int  ln_commit (int con_handle);
extern int  ln_rollback (int con_handle);

extern int  ln_prepare (int con_handle, char * sql_stmt, char flag);
extern int  ln_execute (int req_handle, char flag );
extern int  ln_cancel (int req_handle);
extern int  ln_close_req_handle (int req_handle);

extern int  ln_bind_param (int req_handle, int index, LN_VARIANT_PTR value);
extern int  ln_get_bind_num (int req_handle);
extern int  ln_fetch (int reg_handle);

#endif